<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理页面</title>
<link href="{webroot}theme/admin/css/iframe.css" rel="stylesheet" type="text/css" />
<link href="{webroot}lib/css/jquery.colorpicker.css" rel="stylesheet" type="text/css" />
<script src="{webroot}lib/js/jquery.js"></script>
<script src="{webroot}lib/js/jquery-migrate-1.1.0.min.js"></script>
<script src="{webroot}lib/js/base.js"></script>
<script src="{webroot}lib/tips/jquery.tips.js"></script>
<script src="{webroot}lib/validator/jquery.validator.js"></script>
<script src="{webroot}lib/validator/zh_CN.js"></script>
<script src="{webroot}lib/js/jquery.livequery.js"></script>
<script src="{webroot}lib/js/jquery.colorpicker.js"></script>
<script src="{webroot}theme/admin/js/admin.js"></script>
<script src="{webroot}lib/dialog/artdialog.js"></script>
<!--[if lt IE 9]>
<script src="{webroot}lib/js/html5.js"></script>
<![endif]-->
<script>
$(function(){
	$("#t5_0").click(function(){$("#overdate").css("display","none")});
	$("#t5_1").click(function(){$("#overdate").css("display","block")});
})
</script>
</head>
<body>

<div class="layout-center">
	<div class="right_subject">当前位置：会员 > <a href="?act=list">会员管理</a> > <a href="?act=edit&id={id}&page={page}&sta={sta}&nat={nat}&order={order}&keyword={keyword}">编辑会员</a></div>
    <div class="right_body">
        {dim thisnow:thisnow=sdcms.getdate(now(),"-",1)}
        <div class="table_form">
            {sdcms:rp top="1" table="sd_user" where="id=[id]"}
            <form class="formname" method="post">
                <div class="form_group">
                    <div class="form_txt">用户名：</div>
                    <div class="form_input"><input type="text" name="t0" size="30" maxlength="20" value="{$rp[username]}" class="ip" data-rule="用户名:required;" /><input type="hidden" name="t0_1" value="{$rp[username]}" />　<span>5-20个字符</span></div>
                </div>
                <div class="form_group">
                    <div class="form_txt">密码：</div>
                    <div class="form_input"><input type="text" name="t1" size="30" maxlength="50" class="ip" />　<span>不修改留空，6-16个字符</span></div>
                </div>
                <div class="form_group">
                    <div class="form_txt">昵称：</div>
                    <div class="form_input"><input type="text" name="t8" size="30" maxlength="10" value="{$rp[nickname]}" class="ip" data-rule="昵称:required;nickname;" /></div>
                </div>
                <div class="form_group">
                    <div class="form_txt">邮箱：</div>
                    <div class="form_input"><input type="text" name="t2" size="30" maxlength="255" value="{$rp[email]}" class="ip" data-rule="邮箱:required;email;" /></div>
                </div>
                <div class="form_group">
                    <div class="form_txt">所属会员组：</div>
                    <div class="form_input"><select name="t3" class="ip">
           <option value="0">不属于任何组</option>
           {sdcms:rs top="0" table="sd_user_group"}
            <option value="{$rs[id]}" {if $rs[id]=$rp[groupid]}selected{/if}>{$rs[groupname]}</option>
            {/sdcms:rs}
           </select></div>
                </div>
                <div class="form_group">
                    <div class="form_txt">状态：</div>
                    <div class="form_input"><input type="radio" name="t4" value="1" id="t4_0" {if $rp[islock]=1}checked{/if} /><label for="t4_0">正常</label>
           <input type="radio" name="t4" value="0" id="t4_1" {if $rp[islock]=0}checked{/if} /><label for="t4_1">未激活</label>
           <input type="radio" name="t4" value="-1" id="t4_2" {if $rp[islock]=-1}checked{/if} /><label for="t4_2">锁定</label></div>
                </div>
                <div class="form_group">
                    <div class="form_txt">是否VIP会员：</div>
                    <div class="form_input"><input type="radio" name="t5" value="0" id="t5_0" {if $rp[isvip]=0}checked{/if} /><label for="t5_0">否</label>
           <input type="radio" name="t5" value="1" id="t5_1" {if $rp[isvip]=1}checked{/if} /><label for="t5_1">是</label></div>
                </div>
                <div class="form_group{if $rp[isvip]=0} dis{/if}" id="overdate">
                    <div class="form_txt">到期时间：</div>
                    <div class="form_input"><input type="text" name="t6" size="30" maxlength="20" value="{sdcms.numtodate($rp[overdate])}" class="ip" data-rule="到期时间:required;date;" />　<span>格式：{thisnow}</span></div>
                </div>
                <div class="form_group">
                    <div class="form_txt">备注：</div>
                    <div class="form_input"><textarea name="t7" cols="60" rows="3" class="tt" onKeyUp="strlen_verify(this,'description_len',255)">{$rp[remark]}</textarea>
           　还可输入<span id="description_len">255</span> 个字符</div>
                </div>
                <div class="form_group">
                    <div class="form_bnt"><input type="submit" value="保存" class="bnt_save"><input type="button" value="返回" class="bnt_normal goback"></div>
                </div>
            </form>
            {/sdcms:rp}
        </div>
    </div>
</div>

<script>
$(".formname").validator(
	{
		stopOnError:true,
        theme:'yellow_top',
		ignore:':hidden',
		beforeSubmit:function(){$("input[type='submit']").attr("disabled",true);},
		valid:function(form)
		{
			$.fn.tips({type:'loading',content:'数据提交中'});
			$.ajax(
			{
				url:"?act=editdb&id={id}",
				type:"post",
				data:$(form).serialize(),
				success:function(data){
					data=jQuery.parseJSON(data);
					var type="warn";
					if(data.status=="y"){type="ok";}
					$.fn.tips({type:type,content:data.info});
					if(data.status=="y"){setTimeout('location.href="?act=list&sta={sta}&nat={nat}&order={order}&keyword={keyword}&page={page}"',1000);}
					else
					{$("input[type='submit']").attr("disabled",false);}
					
				}
			});
		},
		invalid:function(){$("input[type='submit']").attr("disabled",false);}
	}
);
</script>
</body>
</html>